//
//  if+extension.swift
//  Maze24
//
//  Created by Mars on 2020/12/21.
//

import SwiftUI

extension View {
  func `if`<T: View>(_ condition: Bool, transform: (Self) -> T) -> TupleView<(Self?, T?)> {
    if condition {
      return TupleView((nil, transform(self)))
    }
    else {
      return TupleView((self, nil))
    }
  }
}
